﻿Imports Microsoft.VisualBasic
Imports System.Data

''' <summary>
''' 通用基础类
''' </summary>
''' <remarks></remarks>
Public Class ClsBase

    ''' <summary>
    ''' 错误信息
    ''' </summary>
    ''' <remarks></remarks>
    Protected mErrMessage As String

    ' 声明区
    ''' <summary>
    ''' 返回类错误信息,只读
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property ErrMessage() As String
        Get
            Return mErrMessage
        End Get
    End Property

    Public ReadOnly Property HasError() As Boolean
        Get
            Return Not String.IsNullOrEmpty(mErrMessage)
        End Get
    End Property

    ''' <summary>
    ''' 设定WebConfig配置信息的读取的属性
    ''' </summary>
    ''' <param name="fKey"></param>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Property AppSettings(ByVal fKey As String) As String
        Get
            Dim RtnString As String = System.Configuration.ConfigurationManager.AppSettings.Item(fKey)
            If String.IsNullOrEmpty(RtnString) Then
                Return String.Empty
            Else
                Return RtnString
            End If
        End Get
        Set(ByVal value As String)
            System.Configuration.ConfigurationManager.AppSettings.Item(fKey) = value
        End Set
    End Property

End Class

